package org.cmg.study.spring.controller;

import org.cmg.study.spring.entity.User;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.ModelAttribute;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpSession;

/**
 * @author CMG
 * @version 1.0
 * @cLassName UserController
 * @description
 * @date 2021/9/6 9:54
 **/
@Controller
public class UserController {

    @RequestMapping(value = "/addUser", method = RequestMethod.GET)
    public String add(@ModelAttribute("user")User user){
        return "addUser";
    }

    @RequestMapping(value = "/showUser", method = RequestMethod.POST)
    public String show(User user, HttpSession session, HttpServletRequest request){
        return "showUser";
    }
}
